#ifndef ELABSTRACTBUTTON_H
#define ELABSTRACTBUTTON_H

#include "elcomponent.h"

class ElIcon;

class ElAbstractButton : public ElComponent
{
    Q_OBJECT
public:
    enum IconStyle { Append, Prepend };

    ElAbstractButton(QWidget *parent = nullptr);

    QString text() const;
    void setText(const QString &text);

    ElIcon *icon() const;
    void setIcon(ElIcon *icon, IconStyle style = Append);
    void setIcon(const QString &filename, int iconSize = 16, IconStyle style = Append);

signals:
    void textChanged(const QString &text);
    void pressed();
    void released();
    void clicked();

protected:
    QString _text;
    ElIcon *_icon = nullptr;
    IconStyle _iconStyle;

private:
    Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
};

#endif // ELABSTRACTBUTTON_H
